package com.example.travelapplication.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.travelapplication.entity.Favor;

import java.util.List;

@Dao
public interface FavorDao {
    @Query("SELECT * FROM favor")
    List<Favor> getAllFavor();

    @Query("SELECT * FROM favor where favorId = :favorId")
    Favor getFavorById(int favorId);

    @Query("SELECT * FROM favor where attId = :attId")
    Favor getFavorByAttId(int attId);

    @Query("DELETE FROM favor")
    void deleteAll();

    @Insert
    void add(Favor favor);

    @Delete
    void delete(Favor favor);

    @Update
    void update(Favor favor);
}
